#ifndef __CORE_WRITEFILE_H__
#define __CORE_WRITEFILE_H__
#include "Vector2.h"
#include "Vector3.h"
#include "Vector4.h"
#include "Matrix3.h"
#include "Matrix4.h"
#include <string>
#include "File.h"

namespace Core
{
	class rtWriteFile : public rtFile
	{
	public:
		rtWriteFile(void);
		virtual ~rtWriteFile(void);

		virtual int length() const;
		virtual int tell() const;
		virtual int seek(long offset, FileSeekOrigin mode);
		virtual void flush();
		virtual void rewind();
		virtual int write(const void* buf, int len);

		virtual int writeInt(const int value);
		virtual int writeUnsignedInt(const unsigned int value);
		virtual int writeShort(const short value);
		virtual int writeUnsignedShort(const unsigned short value);
		virtual int writeChar(const char value);
		virtual int writeUnsignedChar(const unsigned char value);
		virtual int writeByte(const unsigned char value);
		virtual int writeFloat(const float value);
		virtual int writeBool(const bool value);
		virtual int writeString(const std::string& value);
		virtual int writeVector2(const rtVector2& value);
		virtual int writeVector3(const rtVector3& value);
		virtual int writeVector4(const rtVector4& value);
		virtual int writeMatrix3(const rtMatrix3& value);
		virtual int writeMatrix4(const rtMatrix4& value);

		template<typename T>
		inline int writeData(const T& value)
		{
			return write(&value, sizeof(T));
		}

		template<typename T>
		inline int writeArrayData(const T* value, int count)
		{
			return write(value, sizeof(T) * count);
		}

	private: 
		HANDLE m_Handle;

	};
}
#endif


